package cn.coco.jf.fw.api.config;

import com.jfinal.config.Routes;
import com.jfinal.plugin.activerecord.tx.TxByMethodRegex;

public class ApiRoutes extends Routes{

    @Override
    public void config() {

        
    }

    public void configBefore(){
        
    }

    protected void configAfter(){
        addInterceptor(new ApiInterceptor());

        // 注意事务拦截器的先后顺序
//        addInterceptor(new TxByMethodRegex("(doTx.*)", false));
        addInterceptor(new TxByMethodRegex("(do.*save.*|do.*add.*|do.*upd.*|do.*insert.*|do.*del.*|doTx.*)", false));
    }

}
